package com.blackman.skcrawler.core.http.util;


import java.net.InetAddress;
import java.net.UnknownHostException;

public class IpUtils {

    /**
     * 获取本机ip
     */
    public static String getIp(){
        InetAddress addr = null;
        try {
            addr = InetAddress.getLocalHost();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        String ip = addr.getHostAddress().toString(); //获取本机ip
        return ip;
    }

}
